<template>
    <div>
        <!-- 三级联动组件，他是全局组件 -->
        <TypeNav />
        <List />
        <Recommend />
        <Rank />
        <Like />
        <Brand />
        <Floor v-for="(floor, id) in floorList" :key="id" :list="floor" />
    </div>
</template>

<script>
import List from './List'
import Recommend from './Recommend'
import Rank from './Rank'
import Like from './Like'
import Floor from './Floor'
import Brand from './Brand'
import { mapState } from 'vuex'
export default {
    name: 'Home',
    components: { List, Recommend, Rank, Like, Brand, Floor, },
    mounted() {
        this.$store.dispatch('getFloorList')
        // 用户登录后在首页展示
        // this.$store.dispatch('getUserInfo')
    },
    computed: {
        ...mapState(
            {
                floorList: state => { return state.home.floorList }
            }
        )
    }
}
</script>

<style></style>